extern "C" {
    pub type args;
    pub type cmd;
    pub type cmdq_item;
    fn kill(__pid: __pid_t, __sig: i32) -> i32;
    fn getpid() -> __pid_t;
    fn cmd_get_entry(_: *mut cmd) -> *const cmd_entry;
}
pub type __u_int = u32;
pub type __pid_t = i32;
pub type u_int = __u_int;
pub type args_parse_type = u32;
pub const ARGS_PARSE_COMMANDS: args_parse_type = 3;
pub const ARGS_PARSE_COMMANDS_OR_STRING: args_parse_type = 2;
pub const ARGS_PARSE_STRING: args_parse_type = 1;
pub const ARGS_PARSE_INVALID: args_parse_type = 0;
pub type args_parse_cb =
    Option<unsafe extern "C" fn(*mut args, u_int, *mut *mut i8) -> args_parse_type>;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct args_parse {
    pub template: *const i8,
    pub lower: i32,
    pub upper: i32,
    pub cb: args_parse_cb,
}
pub type cmd_find_type = u32;
pub const CMD_FIND_SESSION: cmd_find_type = 2;
pub const CMD_FIND_WINDOW: cmd_find_type = 1;
pub const CMD_FIND_PANE: cmd_find_type = 0;
pub type cmd_retval = i32;
pub const CMD_RETURN_STOP: cmd_retval = 2;
pub const CMD_RETURN_WAIT: cmd_retval = 1;
pub const CMD_RETURN_NORMAL: cmd_retval = 0;
pub const CMD_RETURN_ERROR: cmd_retval = -1;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_entry_flag {
    pub flag: i8,
    pub type_0: cmd_find_type,
    pub flags: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct cmd_entry {
    pub name: *const i8,
    pub alias: *const i8,
    pub args: args_parse,
    pub usage: *const i8,
    pub source: cmd_entry_flag,
    pub target: cmd_entry_flag,
    pub flags: i32,
    pub exec: Option<unsafe extern "C" fn(*mut cmd, *mut cmdq_item) -> cmd_retval>,
}
#[no_mangle]
pub static mut cmd_kill_server_entry: cmd_entry = {
    {
        let mut init = cmd_entry {
            name: b"kill-server\0" as *const u8 as *const i8,
            alias: 0 as *const i8,
            args: {
                let mut init = args_parse {
                    template: b"\0" as *const u8 as *const i8,
                    lower: 0,
                    upper: 0,
                    cb: None,
                };
                init
            },
            usage: b"\0" as *const u8 as *const i8,
            source: cmd_entry_flag {
                flag: 0,
                type_0: CMD_FIND_PANE,
                flags: 0,
            },
            target: cmd_entry_flag {
                flag: 0,
                type_0: CMD_FIND_PANE,
                flags: 0,
            },
            flags: 0,
            exec: Some(
                cmd_kill_server_exec
                    as unsafe extern "C" fn(*mut cmd, *mut cmdq_item) -> cmd_retval,
            ),
        };
        init
    }
};
#[no_mangle]
pub static mut cmd_start_server_entry: cmd_entry = {
    {
        let mut init = cmd_entry {
            name: b"start-server\0" as *const u8 as *const i8,
            alias: b"start\0" as *const u8 as *const i8,
            args: {
                let mut init = args_parse {
                    template: b"\0" as *const u8 as *const i8,
                    lower: 0,
                    upper: 0,
                    cb: None,
                };
                init
            },
            usage: b"\0" as *const u8 as *const i8,
            source: cmd_entry_flag {
                flag: 0,
                type_0: CMD_FIND_PANE,
                flags: 0,
            },
            target: cmd_entry_flag {
                flag: 0,
                type_0: CMD_FIND_PANE,
                flags: 0,
            },
            flags: 0x1 as i32,
            exec: Some(
                cmd_kill_server_exec
                    as unsafe extern "C" fn(*mut cmd, *mut cmdq_item) -> cmd_retval,
            ),
        };
        init
    }
};
extern "C" fn cmd_kill_server_exec(mut self_0: *mut cmd, mut _item: *mut cmdq_item) -> cmd_retval {
    if (unsafe { cmd_get_entry(self_0) }) == (unsafe { &cmd_kill_server_entry }) as *const cmd_entry
    {
        (unsafe { kill(getpid(), 15) });
    }
    return CMD_RETURN_NORMAL;
}
